x86/hvmloader: Don't wait for the producer to fill the ring if
authorAnshul Makkar <anshul.makkar@citrix.com>
Tue, 23 May 2017 14:12:58 +0000 (15:12 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 25 May 2017 08:59:49 +0000 (09:59 +0100)
commitd9eb706356ad4dbd04aad563ec4d2bcd3d7d6c03
treea278fdf259d2a55fe00af4feaeee18b37d28c3ca
parent7cc806d7f1d91dd4c4656f11226f043c749eb0ed
x86/hvmloader: Don't wait for the producer to fill the ring if

The condition: if there is a space in the ring then wait for the producer
to fill the ring also evaluates to true even if the ring if full. It
leads to a deadlock where producer is waiting for consumer
to consume the items and consumer is waiting for producer to fill the ring.

Fix for the issue: check if the ring is full and then break from
the loop to consume the items from the ring.
eg. case: prod = 1272, cons = 248.

Signed-off-by: Anshul Makkar <anshul.makkar@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
tools/firmware/hvmloader/xenbus.c